package com.gof.example.command.macro;

/**
 * Created with IntelliJ IDEA.
 * Created by zhiyuan on 2018/5/10 10:38.
 * haiming.fei@tongdun.cn
 */
public class AddCommand extends Command {

    private Adder adder;

    public AddCommand() {
    }

    public AddCommand(Object object) {
        this(object, new Adder());
    }

    public AddCommand(Object object, Adder adder) {
        super(object);
        this.adder = adder;
    }

    public Adder getAdder() {
        return adder;
    }

    @Override
    void excute() {
        adder.add((Integer) object);
    }
}
